package com.yjd.comm.fundservice.service;

import com.yjd.comm.base.service.IBaseService;
import com.yjd.comm.fundservice.model.FundLoanApplyModel;
import com.yjd.comm.msg.MnsMsgInfo;
import com.yjd.comm.order.model.OrderModel;
import com.yjd.comm.repayment.model.RepaymentDataModel;

import java.util.List;

/**
 * <b>description</b>：贷款申请业务接口<br>
 * <b>time</b>：2018-01-29 10:12:39 <br>
 * <b>author</b>：  yangchangyan@yijiedai.com
 */
public interface IFundLoanApplyService extends IBaseService {
	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public FundLoanApplyModel insert(FundLoanApplyModel model) throws Exception;

	/**
	 * 更新,大于等于1表示成功，其他失败
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(FundLoanApplyModel model) throws Exception;

	/**
	 * 根据id删除,大于等于1表示成功，其他失败
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int delete(long id) throws Exception;

	/**
	 *  贷款申请消息处理
	 * @throws Exception
	 */
	public void loanApplyMsgDispose(MnsMsgInfo mnsMsgInfo)throws Exception;

	/**
	 *  贷款申请成功处理
	 * @throws Exception
	 */
	public void loanApplyPassProcess(Long order_id)throws Exception;

	/**
	 *  贷款申请处理失败
	 * @throws Exception
	 */
	public void loanApplyFailProcess(Long order_id,String msg)throws Exception;


	/**
	 *  创建或更新还款计划
	 *  @param order 订单
	 *  @param period 期数（默认0 表示所有）
	 * @throws Exception
	 */
	public List<RepaymentDataModel> createOrUpdateRepaymentPlan(OrderModel order, int period)throws Exception;

}
